<!DOCTYPE HTML>
<html lang="zh-hans" >
    
    <head>
        
        <meta charset="UTF-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <title>4.课程1:学习数据集 | Apache Drill</title>
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <meta name="description" content="">
        <meta name="generator" content="GitBook 2.6.6">
        <meta name="author" content="smartloli">
        
        <meta name="HandheldFriendly" content="true"/>
        <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="black">
        <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
        <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
        
    <link rel="stylesheet" href="../../gitbook/style.css">
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-tbfed-pagefooter/footer.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
        
    
        
        <link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
        
    
    

        
    
    
    <link rel="next" href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html" />
    
    
    <link rel="prev" href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html" />
    

        
    </head>
    <body>
        
        
    <div class="book"
        data-level="3.4.4"
        data-chapter-title="4.课程1:学习数据集"
        data-filepath="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/4.课程1:学习数据集.md"
        data-basepath="../.."
        data-revision="Fri Aug 26 2016 12:40:11 GMT+0800 (CST)"
        data-innerlanguage="">
    

<div class="book-summary">
    <nav role="navigation">
        <ul class="summary">
            
            
            
                
                <li>
                    <a href="http://drill.smartloli.org" target="blank" class="custom-link">Apache Drill</a>
                </li>
            
            

            
            <li class="divider"></li>
            

            
    
        <li class="chapter " data-level="0" data-path="index.html">
            
                
                    <a href="../../index.html">
                
                        <i class="fa fa-check"></i>
                        
                        前言
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1" >
            
            <span><b>1.</b> 1.开始</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1" data-path="1.开始/1.Introduction 介绍.html">
            
                
                    <a href="../../1.开始/1.Introduction 介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.1.</b>
                        
                        1.Introduction 介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="1.开始/2.Why Drill 为什么使用 Drill.html">
            
                
                    <a href="../../1.开始/2.Why Drill 为什么使用 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>1.2.</b>
                        
                        2.Why Drill 为什么使用 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="2" >
            
            <span><b>2.</b> 2.架构</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="2.1" data-path="2.架构/1.Architecture Introduction 架构介绍.html">
            
                
                    <a href="../../2.架构/1.Architecture Introduction 架构介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.1.</b>
                        
                        1.Architecture Introduction 架构介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.2" data-path="2.架构/2.Drill Query Execution Drill 查询执行.html">
            
                
                    <a href="../../2.架构/2.Drill Query Execution Drill 查询执行.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.2.</b>
                        
                        2.Drill Query Execution Drill 查询执行
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.3" data-path="2.架构/3.Core Modules 核心模块.html">
            
                
                    <a href="../../2.架构/3.Core Modules 核心模块.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.3.</b>
                        
                        3.Core Modules 核心模块
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="2.4" data-path="2.架构/4.Performance 性能.html">
            
                
                    <a href="../../2.架构/4.Performance 性能.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>2.4.</b>
                        
                        4.Performance 性能
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3" >
            
            <span><b>3.</b> 3.教程</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.1" data-path="3.教程/1.Tutorials Introduction 教程介绍.html">
            
                
                    <a href="../../3.教程/1.Tutorials Introduction 教程介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.1.</b>
                        
                        1.Tutorials Introduction 教程介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.2" data-path="3.教程/2.Drill in 10 Minutes 快速指导.html">
            
                
                    <a href="../../3.教程/2.Drill in 10 Minutes 快速指导.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.2.</b>
                        
                        2.Drill in 10 Minutes 快速指导
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.3" data-path="3.教程/3.A-Y-A-D 数据集分析.html">
            
                
                    <a href="../../3.教程/3.A-Y-A-D 数据集分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.3.</b>
                        
                        3.A-Y-A-D 数据集分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4" >
            
            <span><b>3.4.</b> 4.在 MapR 的 Sandbox 中学习 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="3.4.1" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html">
            
                
                    <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/1.关于 MapR 的 Sandbox.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.1.</b>
                        
                        1.关于 MapR 的 Sandbox
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.2" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/2.在 Sandbox 中安装 Drill.html">
            
                
                    <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/2.在 Sandbox 中安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.2.</b>
                        
                        2.在 Sandbox 中安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.3" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html">
            
                
                    <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.3.</b>
                        
                        3.在 Sandbox 中使用 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter active" data-level="3.4.4" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/4.课程1:学习数据集.html">
            
                
                    <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/4.课程1:学习数据集.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.4.</b>
                        
                        4.课程1:学习数据集
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.5" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html">
            
                
                    <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.5.</b>
                        
                        5.课程2:使用 ANSI SQL 查询
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.6" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/6.课程3:查询复杂的数据类型.html">
            
                
                    <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/6.课程3:查询复杂的数据类型.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.6.</b>
                        
                        6.课程3:查询复杂的数据类型
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.4.7" data-path="3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html">
            
                
                    <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/7.总结.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.4.7.</b>
                        
                        7.总结
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="3.5" data-path="3.教程/5.高度动态的数据集分析.html">
            
                
                    <a href="../../3.教程/5.高度动态的数据集分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.5.</b>
                        
                        5.高度动态的数据集分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.6" data-path="3.教程/6.社会媒体分析.html">
            
                
                    <a href="../../3.教程/6.社会媒体分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.6.</b>
                        
                        6.社会媒体分析
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="3.7" data-path="3.教程/7.使用窗口函数分析数据.html">
            
                
                    <a href="../../3.教程/7.使用窗口函数分析数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>3.7.</b>
                        
                        7.使用窗口函数分析数据
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4" >
            
            <span><b>4.</b> 4.安装 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.1" data-path="4.安装 Drill/1.Drill 安装介绍.html">
            
                
                    <a href="../../4.安装 Drill/1.Drill 安装介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.1.</b>
                        
                        1.Drill 安装介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.2" data-path="4.安装 Drill/2.迁移 Parquet 数据.html">
            
                
                    <a href="../../4.安装 Drill/2.迁移 Parquet 数据.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.2.</b>
                        
                        2.迁移 Parquet 数据
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3" >
            
            <span><b>4.3.</b> 3.安装 Drill 到嵌入模式</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.3.1" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/1.嵌入模式的先决条件.html">
            
                
                    <a href="../../4.安装 Drill/3.安装 Drill 到嵌入模式/1.嵌入模式的先决条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.1.</b>
                        
                        1.嵌入模式的先决条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.2" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/2.在 Linux 和 Mac OS X 上安装 Drill.html">
            
                
                    <a href="../../4.安装 Drill/3.安装 Drill 到嵌入模式/2.在 Linux 和 Mac OS X 上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.2.</b>
                        
                        2.在 Linux 和 Mac OS X 上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.3" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/3.在 Linux 和 Mac OS X 上启动 Drill.html">
            
                
                    <a href="../../4.安装 Drill/3.安装 Drill 到嵌入模式/3.在 Linux 和 Mac OS X 上启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.3.</b>
                        
                        3.在 Linux 和 Mac OS X 上启动 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.4" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/4.在 Windows 上安装 Drill.html">
            
                
                    <a href="../../4.安装 Drill/3.安装 Drill 到嵌入模式/4.在 Windows 上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.4.</b>
                        
                        4.在 Windows 上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.3.5" data-path="4.安装 Drill/3.安装 Drill 到嵌入模式/5.在 Windows 上启动 Drill.html">
            
                
                    <a href="../../4.安装 Drill/3.安装 Drill 到嵌入模式/5.在 Windows 上启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.3.5.</b>
                        
                        5.在 Windows 上启动 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.4" >
            
            <span><b>4.4.</b> 4.安装 Drill 到分布式模式</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="4.4.1" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/1.分布式模式的先决条件.html">
            
                
                    <a href="../../4.安装 Drill/4.安装 Drill 到分布式模式/1.分布式模式的先决条件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.1.</b>
                        
                        1.分布式模式的先决条件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.2" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/2.在集群上安装 Drill.html">
            
                
                    <a href="../../4.安装 Drill/4.安装 Drill 到分布式模式/2.在集群上安装 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.2.</b>
                        
                        2.在集群上安装 Drill
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="4.4.3" data-path="4.安装 Drill/4.安装 Drill 到分布式模式/3.在分布式模式下启动 Drill.html">
            
                
                    <a href="../../4.安装 Drill/4.安装 Drill 到分布式模式/3.在分布式模式下启动 Drill.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.4.3.</b>
                        
                        3.在分布式模式下启动 Drill
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="4.5" data-path="4.安装 Drill/5.启动 Web 控制台.html">
            
                
                    <a href="../../4.安装 Drill/5.启动 Web 控制台.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>4.5.</b>
                        
                        5.启动 Web 控制台
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5" >
            
            <span><b>5.</b> 5.配置 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.1" data-path="5.配置 Drill/1.配置介绍.html">
            
                
                    <a href="../../5.配置 Drill/1.配置介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.1.</b>
                        
                        1.配置介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.2" data-path="5.配置 Drill/2.配置内存.html">
            
                
                    <a href="../../5.配置 Drill/2.配置内存.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.2.</b>
                        
                        2.配置内存
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3" >
            
            <span><b>5.3.</b> 3.配置一个多租户集群</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.3.1" data-path="5.配置 Drill/3.配置一个多租户集群/1.配置一个多租户介绍.html">
            
                
                    <a href="../../5.配置 Drill/3.配置一个多租户集群/1.配置一个多租户介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.1.</b>
                        
                        1.配置一个多租户介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3.2" data-path="5.配置 Drill/3.配置一个多租户集群/2.配置多租户资源.html">
            
                
                    <a href="../../5.配置 Drill/3.配置一个多租户集群/2.配置多租户资源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.2.</b>
                        
                        2.配置多租户资源
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.3.3" data-path="5.配置 Drill/3.配置一个多租户集群/3.配置 Drillbit 共享资源.html">
            
                
                    <a href="../../5.配置 Drill/3.配置一个多租户集群/3.配置 Drillbit 共享资源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.3.3.</b>
                        
                        3.配置 Drillbit 共享资源
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.4" data-path="5.配置 Drill/4.配置模拟身份.html">
            
                
                    <a href="../../5.配置 Drill/4.配置模拟身份.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.4.</b>
                        
                        4.配置模拟身份
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.5" data-path="5.配置 Drill/5.配置用户身份验证.html">
            
                
                    <a href="../../5.配置 Drill/5.配置用户身份验证.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.5.</b>
                        
                        5.配置用户身份验证
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.6" data-path="5.配置 Drill/6.配置 Hive 用户身份验证.html">
            
                
                    <a href="../../5.配置 Drill/6.配置 Hive 用户身份验证.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.6.</b>
                        
                        6.配置 Hive 用户身份验证
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.7" data-path="5.配置 Drill/7.配置 Web 控制台和 REST API 安全.html">
            
                
                    <a href="../../5.配置 Drill/7.配置 Web 控制台和 REST API 安全.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.7.</b>
                        
                        7.配置 Web 控制台和 REST API 安全
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8" >
            
            <span><b>5.8.</b> 8.可选配置</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="5.8.1" data-path="5.配置 Drill/8.可选配置/1.可选配置介绍.html">
            
                
                    <a href="../../5.配置 Drill/8.可选配置/1.可选配置介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.1.</b>
                        
                        1.可选配置介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.2" data-path="5.配置 Drill/8.可选配置/2.启动可选项.html">
            
                
                    <a href="../../5.配置 Drill/8.可选配置/2.启动可选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.2.</b>
                        
                        2.启动可选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.3" data-path="5.配置 Drill/8.可选配置/3.计划和执行可选项.html">
            
                
                    <a href="../../5.配置 Drill/8.可选配置/3.计划和执行可选项.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.3.</b>
                        
                        3.计划和执行可选项
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.8.4" data-path="5.配置 Drill/8.可选配置/4.持久化配置存储.html">
            
                
                    <a href="../../5.配置 Drill/8.可选配置/4.持久化配置存储.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.8.4.</b>
                        
                        4.持久化配置存储
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="5.9" data-path="5.配置 Drill/9.Drill 端口使用.html">
            
                
                    <a href="../../5.配置 Drill/9.Drill 端口使用.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.9.</b>
                        
                        9.Drill 端口使用
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="5.10" data-path="5.配置 Drill/10.配置 Drill 终端.html">
            
                
                    <a href="../../5.配置 Drill/10.配置 Drill 终端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>5.10.</b>
                        
                        10.配置 Drill 终端
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6" >
            
            <span><b>6.</b> 6.连接数据源</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.1" data-path="6.连接数据源/1.介绍.html">
            
                
                    <a href="../../6.连接数据源/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.2" data-path="6.连接数据源/2.注册存储插件.html">
            
                
                    <a href="../../6.连接数据源/2.注册存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.2.</b>
                        
                        2.注册存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3" >
            
            <span><b>6.3.</b> 3.配置存储插件</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="6.3.1" data-path="6.连接数据源/3.配置存储插件/1.插件基础设置.html">
            
                
                    <a href="../../6.连接数据源/3.配置存储插件/1.插件基础设置.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.1.</b>
                        
                        1.插件基础设置
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3.2" data-path="6.连接数据源/3.配置存储插件/2.工作区间.html">
            
                
                    <a href="../../6.连接数据源/3.配置存储插件/2.工作区间.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.2.</b>
                        
                        2.工作区间
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.3.3" data-path="6.连接数据源/3.配置存储插件/3.Drill 默认输出格式.html">
            
                
                    <a href="../../6.连接数据源/3.配置存储插件/3.Drill 默认输出格式.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.3.3.</b>
                        
                        3.Drill 默认输出格式
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="6.4" data-path="6.连接数据源/4.文件系统存储插件.html">
            
                
                    <a href="../../6.连接数据源/4.文件系统存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.4.</b>
                        
                        4.文件系统存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.5" data-path="6.连接数据源/5.HBase 存储插件.html">
            
                
                    <a href="../../6.连接数据源/5.HBase 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.5.</b>
                        
                        5.HBase 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.6" data-path="6.连接数据源/6.Hive 存储插件.html">
            
                
                    <a href="../../6.连接数据源/6.Hive 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.6.</b>
                        
                        6.Hive 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.7" data-path="6.连接数据源/7.RDBMS 存储插件.html">
            
                
                    <a href="../../6.连接数据源/7.RDBMS 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.7.</b>
                        
                        7.RDBMS 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.8" data-path="6.连接数据源/8.MongoDB 存储插件.html">
            
                
                    <a href="../../6.连接数据源/8.MongoDB 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.8.</b>
                        
                        8.MongoDB 存储插件
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="6.9" data-path="6.连接数据源/9.S3 存储插件.html">
            
                
                    <a href="../../6.连接数据源/9.S3 存储插件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>6.9.</b>
                        
                        9.S3 存储插件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7" >
            
            <span><b>7.</b> 7.ODBC 和 JDBC 接口</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.1" data-path="7.ODBC 和 JDBC 接口/1.介绍.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.2" data-path="7.ODBC 和 JDBC 接口/2.使用 JDBC 驱动.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/2.使用 JDBC 驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.2.</b>
                        
                        2.使用 JDBC 驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.3" data-path="7.ODBC 和 JDBC 接口/3.在 Windows 上使用 JDBC 和 SQuirreL.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/3.在 Windows 上使用 JDBC 和 SQuirreL.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.3.</b>
                        
                        3.在 Windows 上使用 JDBC 和 SQuirreL
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4" >
            
            <span><b>7.4.</b> 4.安装 ODBC 驱动</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.4.1" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/1.在 Linux 上安装驱动.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/1.在 Linux 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.1.</b>
                        
                        1.在 Linux 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.2" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/2.在 Mac OS X 上安装驱动.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/2.在 Mac OS X 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.2.</b>
                        
                        2.在 Mac OS X 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.3" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/3.在 Windows 上安装驱动.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/3.在 Windows 上安装驱动.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.3.</b>
                        
                        3.在 Windows 上安装驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.4.4" data-path="7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/4.在 Windows 上安装 TDC 文件.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/4.安装 ODBC 驱动/4.在 Windows 上安装 TDC 文件.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.4.4.</b>
                        
                        4.在 Windows 上安装 TDC 文件
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.5" >
            
            <span><b>7.5.</b> 5.配置 ODBC</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.5.1" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/1.ODBC 配置参考.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/5.配置 ODBC/1.ODBC 配置参考.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.1.</b>
                        
                        1.ODBC 配置参考
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.2" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/2.在 Linux 上配置 ODBC.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/5.配置 ODBC/2.在 Linux 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.2.</b>
                        
                        2.在 Linux 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.3" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/3.在 Max OS X 上配置 ODBC.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/5.配置 ODBC/3.在 Max OS X 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.3.</b>
                        
                        3.在 Max OS X 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.4" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/4.在 Windows 上配置 ODBC.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/5.配置 ODBC/4.在 Windows 上配置 ODBC.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.4.</b>
                        
                        4.在 Windows 上配置 ODBC
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.5.5" data-path="7.ODBC 和 JDBC 接口/5.配置 ODBC/5.测试 ODBC 连接.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/5.配置 ODBC/5.测试 ODBC 连接.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.5.5.</b>
                        
                        5.测试 ODBC 连接
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.6" >
            
            <span><b>7.6.</b> 6.使用 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.6.1" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/1.介绍.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/6.使用 Drill/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6.2" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/2.连接 Drill 到数据源.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/6.使用 Drill/2.连接 Drill 到数据源.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.2.</b>
                        
                        2.连接 Drill 到数据源
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.6.3" data-path="7.ODBC 和 JDBC 接口/6.使用 Drill/3.浏览数据和定义视图.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/6.使用 Drill/3.浏览数据和定义视图.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.6.3.</b>
                        
                        3.浏览数据和定义视图
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="7.7" >
            
            <span><b>7.7.</b> 7.用 BI 工具连接 Drill</span>
            
            
            <ul class="articles">
                
    
        <li class="chapter " data-level="7.7.1" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/1.介绍.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/1.介绍.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.1.</b>
                        
                        1.介绍
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.2" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/2.Tableau 示例.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/2.Tableau 示例.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.2.</b>
                        
                        2.使用 JDBC 驱动
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.3" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/3.使用 MicroStrategy 分析.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/3.使用 MicroStrategy 分析.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.3.</b>
                        
                        3.在 Windows 上使用 JDBC 和 SQuirreL
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.4" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/4.使用 Tibco Spotfire 客户端.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/4.使用 Tibco Spotfire 客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.4.</b>
                        
                        4.使用 Tibco Spotfire 客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.5" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/5.使用 Qlik Sense.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/5.使用 Qlik Sense.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.5.</b>
                        
                        5.使用 Qlik Sense
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.6" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/6.使用 Tableau 9 客户端.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/6.使用 Tableau 9 客户端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.6.</b>
                        
                        6.使用 Tableau 9 客户端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.7" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/7.使用 Tableau 9 服务端.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/7.使用 Tableau 9 服务端.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.7.</b>
                        
                        7.使用 Tableau 9 服务端
                    </a>
            
            
        </li>
    
        <li class="chapter " data-level="7.7.8" data-path="7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/8.配置 JReport.html">
            
                
                    <a href="../../7.ODBC 和 JDBC 接口/7.用 BI 工具连接 Drill/8.配置 JReport.html">
                
                        <i class="fa fa-check"></i>
                        
                            <b>7.7.8.</b>
                        
                        8.配置 JReport
                    </a>
            
            
        </li>
    

            </ul>
            
        </li>
    

            </ul>
            
        </li>
    


            
            <li class="divider"></li>
            <li>
                <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
                    本书使用 GitBook 发布
                </a>
            </li>
            
        </ul>
    </nav>
</div>

    <div class="book-body">
        <div class="body-inner">
            <div class="book-header" role="navigation">
    <!-- Actions Left -->
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../../" >Apache Drill</a>
    </h1>
</div>

            <div class="page-wrapper" tabindex="-1" role="main">
                <div class="page-inner">
                
                
                    <section class="normal" id="section-">
                    
                        <h1 id="&#x8BFE;&#x7A0B;1&#xFF1A;&#x5B66;&#x4E60;&#x6570;&#x636E;&#x96C6;">&#x8BFE;&#x7A0B;1&#xFF1A;&#x5B66;&#x4E60;&#x6570;&#x636E;&#x96C6;</h1>
<h2 id="&#x76EE;&#x6807;">&#x76EE;&#x6807;</h2>
<p>&#x672C;&#x8BFE;&#x7B80;&#x5355;&#x7684;&#x4ECB;&#x7ECD;&#x4EC0;&#x4E48;&#x6570;&#x636E;&#x53EF;&#x7528;&#xFF0C;&#x683C;&#x5F0F;&#x662F;&#x4EC0;&#x4E48;&#xFF0C;&#x5E76;&#x4F7F;&#x7528;&#x7B80;&#x5355;&#x7684; <code>SELECT</code> &#x8FD9;&#x6837;&#x7684; SQL &#x8BED;&#x53E5;&#x3002;Drill &#x53EF;&#x4EE5;&#x5728;&#x672A;&#x77E5;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x6709;&#x80FD;&#x529B;&#x53BB;&#x5206;&#x6790;&#x6570;&#x636E;&#xFF0C;&#x5E76;&#x80FD;&#x591F;&#x53BB;&#x5B9A;&#x4E49;&#x5B83;&#x7684; Schema&#x3002;&#x8FD9;&#x610F;&#x5473;&#x7740;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x7ACB;&#x5373;&#x5F00;&#x59CB;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#xFF08;&#x5C3D;&#x7BA1;&#x5B83;&#x66F4;&#x6539;&#x4E86;&#xFF09;&#xFF0C;&#x800C;&#x4E0D;&#x7528;&#x5728;&#x4E4E;&#x5B83;&#x7684;&#x683C;&#x5F0F;&#x3002;</p>
<p>&#x672C;&#x6307;&#x5357;&#x6240;&#x5305;&#x542B;&#x7684;&#x6570;&#x636E;&#x96C6;&#x7531;&#x4EE5;&#x4E0B;&#x7EC4;&#x6210;&#xFF1A;</p>
<ul>
<li>&#x4E8B;&#x52A1;&#x6570;&#x636E;&#xFF1A;&#x5B58;&#x50A8;&#x5728; Hive &#x8868;</li>
<li>&#x5546;&#x54C1;&#x7684; catalog &#x548C;&#x5BA2;&#x6237;&#x6570;&#x636E;&#xFF1A;&#x5B58;&#x50A8;&#x5728; MapR-DB &#x8868;&#x4E2D;</li>
<li>&#x70B9;&#x51FB;&#x65E5;&#x5FD7;&#x6570;&#x636E;&#xFF1A;&#x4EE5; JSON &#x6587;&#x4EF6;&#x7684;&#x5F62;&#x5F0F;&#xFF0C;&#x5B58;&#x50A8;&#x5728; MapR &#x7684;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E2D;</li>
</ul>
<h2 id="&#x672C;&#x8BFE;&#x7684;&#x67E5;&#x8BE2;">&#x672C;&#x8BFE;&#x7684;&#x67E5;&#x8BE2;</h2>
<p>&#x672C;&#x8BFE;&#x5C06;&#x4F7F;&#x7528; <code>select *</code> &#x53BB;&#x67E5;&#x8BE2;&#x6BCF;&#x4E2A;&#x6570;&#x636E;&#x6E90;&#x3002;</p>
<h2 id="&#x5F00;&#x59CB;&#x4E4B;&#x524D;">&#x5F00;&#x59CB;&#x4E4B;&#x524D;</h2>
<h3 id="&#x6253;&#x5F00;-drill-shell">&#x6253;&#x5F00; Drill Shell</h3>
<p>&#x5982;&#x679C;&#x4F60;&#x7684; Drill Shell &#x8FD8;&#x6CA1;&#x6709;&#x542F;&#x52A8;&#xFF0C;&#x4F7F;&#x7528;&#x7EC8;&#x7AEF;&#x6216; CMD &#x5728;&#x865A;&#x62DF;&#x673A;&#x4E2D;&#x6253;&#x5F00;&#xFF0C;&#x7136;&#x540E;&#x8F93;&#x5165; <code>sqlline</code>&#xFF0C;&#x5728; <a href="3.&#x5728;%20Sandbox%20&#x4E2D;&#x4F7F;&#x7528;%20Drill.md">&#x5728; Sandbox &#x4E2D;&#x4F7F;&#x7528; Drill</a> &#x4E00;&#x8282;&#x4E2D;&#x7531;&#x8BE6;&#x7EC6;&#x7684;&#x4ECB;&#x7ECD;&#x3002;</p>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#x5B8C;&#x6210;&#x67E5;&#x8BE2;&#x3002;&#x6700;&#x540E;&#x9000;&#x51FA; Drill Shell&#xFF0C;&#x547D;&#x4EE4;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; !quit
</code></pre>
<p>&#x672C;&#x793A;&#x4F8B;&#x662F;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#x4F7F;&#x7528; Drill Shell&#x3002;&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; Drill Web &#x63A7;&#x5236;&#x53F0;&#x53BB;&#x5B8C;&#x6210;&#x67E5;&#x8BE2;&#x3002;</p>
<h3 id="&#x542F;&#x7528;-decimal-&#x6570;&#x636E;&#x7C7B;&#x578B;">&#x542F;&#x7528; DECIMAL &#x6570;&#x636E;&#x7C7B;&#x578B;</h3>
<p>&#x7EC8;&#x7AEF;&#x4E2D;&#x6F14;&#x793A;&#x7684;&#x662F;&#x4F7F;&#x7528; DECIMAL &#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x793A;&#x4F8B;&#x3002;DECIMAL &#x6570;&#x636E;&#x7C7B;&#x578B;&#x9ED8;&#x8BA4;&#x662F;&#x7981;&#x6B62;&#x7684;&#x5728;&#x53D1;&#x5E03;&#x7684;&#x7248;&#x672C;&#x5F53;&#x4E2D;&#xFF0C;&#x6240;&#x4EE5;&#xFF0C;&#x5728;&#x5904;&#x7406;&#x4E4B;&#x524D;&#x9700;&#x8981;&#x6211;&#x4EEC;&#x53BB;&#x5F00;&#x542F; DECIMAL &#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;</p>
<pre><code class="lang-bash">alter session <span class="hljs-built_in">set</span> `planner.enable_decimal_data_<span class="hljs-built_in">type</span>`=<span class="hljs-literal">true</span>;

+-------+--------------------------------------------+
|  ok   |                  summary                   |
+-------+--------------------------------------------+
| <span class="hljs-literal">true</span>  | planner.enable_decimal_data_<span class="hljs-built_in">type</span> updated.  |
+-------+--------------------------------------------+
<span class="hljs-number">1</span> row selected
</code></pre>
<h3 id="&#x663E;&#x793A;&#x53EF;&#x7528;&#x7684;&#x6570;&#x636E;&#x5E93;">&#x663E;&#x793A;&#x53EF;&#x7528;&#x7684;&#x6570;&#x636E;&#x5E93;</h3>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; show databases;
+---------------------+
|     SCHEMA_NAME     |
+---------------------+
| INFORMATION_SCHEMA  |
| cp.default          |
| dfs.clicks          |
| dfs.default         |
| dfs.logs            |
| dfs.root            |
| dfs.tmp             |
| dfs.views           |
| hive.default        |
| maprdb              |
| sys                 |
+---------------------+
</code></pre>
<p>&#x8BE5;&#x547D;&#x4EE4;&#x5C55;&#x793A;&#x4E86;&#x5728;&#x5B58;&#x50A8;&#x63D2;&#x4EF6;&#x4E2D;&#xFF0C;&#x6240;&#x6709;&#x53EF;&#x7528;&#x7684;&#x5143;&#x6570;&#x636E;&#x3002;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E2D;&#x914D;&#x7F6E;&#x7684; Hive&#xFF0C;MapR-DB &#x6570;&#x636E;&#x5E93;&#xFF0C;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x6216;&#x662F;&#x5176;&#x4ED6;&#x7684;&#x6570;&#x636E;&#x3002;&#x5F53;&#x4F60;&#x5728;&#x672C;&#x6307;&#x5357;&#x4E2D;&#x8FD0;&#x884C;&#x67E5;&#x8BE2;&#x7684;&#x65F6;&#x5019;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>USE</code> &#x547D;&#x4EE4;&#x53BB;&#x505A;&#x5207;&#x6362;&#x3002;&#x8FD9;&#x6837;&#x7684;&#x65B9;&#x5F0F;&#x548C;&#x5173;&#x7CFB;&#x578B;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x5207;&#x6362;&#x4E0D;&#x540C;&#x7684;&#x6570;&#x636E;&#x5E93;&#x5F88;&#x7C7B;&#x4F3C;&#x3002;</p>
<h2 id="&#x67E5;&#x8BE2;-hive-&#x8868;">&#x67E5;&#x8BE2; Hive &#x8868;</h2>
<p>&#x8BA2;&#x5355;&#x8868;&#x662F;&#x4E00;&#x4E2A; 6 &#x5217;&#x7684; Hive &#x8868;&#x5728; Hive &#x5143;&#x6570;&#x636E;&#x4E2D;&#x3002;&#x8FD9;&#x4E2A; Hive &#x7684;&#x5916;&#x90E8;&#x8868;&#x6307;&#x5411;&#x5B58;&#x50A8;&#x5728; MapR &#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E2D;&#x7684;&#x6570;&#x636E;&#x3002;&#x8BA2;&#x5355;&#x8868;&#x5305;&#x542B; 122000 &#x884C;&#x8BB0;&#x5F55;&#x3002;</p>
<h3 id="&#x8BBE;&#x7F6E;-hive-&#x7684;-schema&#xFF1A;">&#x8BBE;&#x7F6E; hive &#x7684; schema&#xFF1A;</h3>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; use hive.`default`;
+-------+-------------------------------------------+
|  ok   |                  summary                  |
+-------+-------------------------------------------+
| <span class="hljs-literal">true</span>  | Default schema changed to [hive.default]  |
+-------+-------------------------------------------+
<span class="hljs-number">1</span> row selected
</code></pre>
<p>&#x4F60;&#x53EF;&#x4EE5;&#x5728;&#x7EC8;&#x7AEF;&#x4E2D;&#x4F7F;&#x7528; <code>USE</code> &#x547D;&#x4EE4;&#x3002;&#x4F7F;&#x7528; <code>USE</code> &#x547D;&#x4EE4;&#x8BBE;&#x7F6E; schema &#x5230;&#x5F53;&#x524D;&#x7684;&#x4F1A;&#x8BDD;&#x4E2D;&#x3002;</p>
<h3 id="&#x8868;&#x63CF;&#x8FF0;">&#x8868;&#x63CF;&#x8FF0;</h3>
<p>&#x4F60;&#x4E5F;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>DESCRIBE</code> &#x547D;&#x4EE4;&#x53BB;&#x663E;&#x793A; Hive &#x8868;&#x4E2D;&#x7684;&#x5217;&#x548C;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; describe orders;
+-------------+------------+-------------+
| COLUMN_NAME | DATA_TYPE  | IS_NULLABLE |
+-------------+------------+-------------+
| order_id    | BIGINT     | YES         |
| month       | VARCHAR    | YES         |
| cust_id     | BIGINT     | YES         |
| state       | VARCHAR    | YES         |
| prod_id     | BIGINT     | YES         |
| order_total | INTEGER    | YES         |
+-------------+------------+-------------+
</code></pre>
<p>&#x5BF9;&#x4E8E; <code>DESCRIBE</code> &#x547D;&#x4EE4;&#xFF0C;&#x8FD4;&#x56DE;&#x7684;&#x662F; Hive &#x8868;&#x4E2D; schema &#x7684;&#x76F8;&#x5173;&#x4FE1;&#x606F;&#x3002;</p>
<h3 id="&#x4ECE;&#x8BA2;&#x5355;&#x8868;&#x4E2D;&#x83B7;&#x53D6;-5-&#x6761;&#x8BB0;&#x5F55;">&#x4ECE;&#x8BA2;&#x5355;&#x8868;&#x4E2D;&#x83B7;&#x53D6; 5 &#x6761;&#x8BB0;&#x5F55;</h3>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; select * from orders <span class="hljs-built_in">limit</span> <span class="hljs-number">5</span>;
+------------+------------+------------+------------+------------+-------------+
|  order_id  |   month    |  cust_id   |   state    |  prod_id   | order_total |
+------------+------------+------------+------------+------------+-------------+
| <span class="hljs-number">67212</span>      | June       | <span class="hljs-number">10001</span>      | ca         | <span class="hljs-number">909</span>        | <span class="hljs-number">13</span>          |
| <span class="hljs-number">70302</span>      | June       | <span class="hljs-number">10004</span>      | ga         | <span class="hljs-number">420</span>        | <span class="hljs-number">11</span>          |
| <span class="hljs-number">69090</span>      | June       | <span class="hljs-number">10011</span>      | fl         | <span class="hljs-number">44</span>         | <span class="hljs-number">76</span>          |
| <span class="hljs-number">68834</span>      | June       | <span class="hljs-number">10012</span>      | ar         | <span class="hljs-number">0</span>          | <span class="hljs-number">81</span>          |
| <span class="hljs-number">71220</span>      | June       | <span class="hljs-number">10018</span>      | az         | <span class="hljs-number">411</span>        | <span class="hljs-number">24</span>          |
+------------+------------+------------+------------+------------+-------------+
</code></pre>
<p>&#x56E0;&#x4E3A;&#x8BA2;&#x5355;&#x8868;&#x662F;&#x4E00;&#x4E2A; Hive &#x8868;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x67E5;&#x8BE2;&#x6570;&#x636E;&#x7528;&#x548C;&#x67E5;&#x8BE2;&#x5173;&#x7CFB;&#x578B;&#x6570;&#x636E;&#x5E93;&#x8868;&#x4E00;&#x6837;&#x7684;&#x65B9;&#x5F0F;&#x53BB;&#x67E5;&#x8BE2;&#x3002;&#x6CE8;&#x610F;&#x4F7F;&#x7528;&#x6807;&#x51C6;&#x7684; <code>LIMIT</code> &#x8BED;&#x6CD5;&#xFF0C;&#x8FD4;&#x56DE;&#x7684;&#x6570;&#x636E;&#x96C6;&#x7ED3;&#x679C;&#x662F;&#x4ECE;&#x6700;&#x5F00;&#x59CB;&#x7684;&#x884C;&#x5230;&#x6307;&#x5B9A;&#x7684;&#x884C;&#x3002;&#x4F60;&#x53EF;&#x4EE5;&#x4F7F;&#x7528; <code>LIMIT</code> &#x548C; <code>ORDER BY</code> &#x8FDB;&#x884C;&#x7EC4;&#x5408;&#x3002;&#x53E6;&#x5916;&#xFF0C;&#x7528; <code>LIMIT 5,10</code> &#x8FD9;&#x6837;&#x7684;&#x5206;&#x9875;&#x8BED;&#x53E5;&#xFF0C;&#x5728; Drill &#x4E2D;&#x662F;&#x4E0D;&#x80FD;&#x76F4;&#x63A5;&#x7528;&#x7684;&#xFF0C;&#x9700;&#x8981;&#x8F6C;&#x53D8;&#x5199;&#x6CD5;&#xFF0C;&#x5728;&#x540E;&#x9762;&#x7684;&#x7AE0;&#x8282;&#x4F1A;&#x8BB2;&#x5230;&#x3002;</p>
<p>Drill &#x53EF;&#x4EE5;&#x65E0;&#x7F1D;&#x7684;&#x96C6;&#x6210;&#x5230; Hive &#x4E0A;&#xFF0C;&#x5E76;&#x5141;&#x8BB8;&#x53BB;&#x67E5;&#x8BE2; Hive &#x8868;&#x7684;&#x5143;&#x6570;&#x636E;&#xFF0C;&#x65E0;&#x9700;&#x989D;&#x5916;&#x7684;&#x914D;&#x7F6E;&#x3002;&#x5BF9;&#x4E8E; Drill &#x6765;&#x8BF4;&#xFF0C;Hive &#x4E0D;&#x662F;&#x5148;&#x51B3;&#x6761;&#x4EF6;&#x3002;&#x4F46;&#x662F;&#x53EF;&#x4EE5;&#x7B80;&#x5355;&#x7684;&#x4F5C;&#x4E3A;&#x5B58;&#x50A8;&#x63D2;&#x4EF6;&#x6216;&#x6570;&#x636E;&#x6E90;&#x670D;&#x52A1;&#x4E8E; Drill&#x3002;Drill &#x5141;&#x8BB8;&#x7528;&#x6237;&#x67E5;&#x8BE2;&#x6240;&#x6709;&#x7684; Hive &#x6587;&#x4EF6;&#x683C;&#x5F0F;&#xFF08;&#x5305;&#x62EC;&#x81EA;&#x5B9A;&#x4E49;&#x7684;SerDes&#xFF09;&#x3002;&#x53E6;&#x5916;&#xFF0C;&#x4EFB;&#x4F55; UDFS &#x51FD;&#x6570;&#x90FD;&#x53EF;&#x4EE5;&#x4F5C;&#x4E3A; Drill &#x67E5;&#x8BE2;&#x7684;&#x4E00;&#x90E8;&#x5206;&#x6765;&#x4F7F;&#x7528;&#x3002;</p>
<p>&#x56E0;&#x4E3A; Drill &#x662F;&#x4E00;&#x4E2A;&#x5C5E;&#x4E8E;&#x4F4E;&#x5EF6;&#x65F6;&#x7684; SQL &#x67E5;&#x8BE2;&#x5F15;&#x64CE;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x67E5;&#x8BE2; Hive &#x8868;&#x3002;&#x5B83;&#x5177;&#x6709;&#x9AD8;&#x6027;&#x80FD;&#xFF0C;&#x652F;&#x6301;&#x4EA4;&#x4E92;&#x5F0F;&#x548C;&#x4E34;&#x65F6;&#x7684;&#x6570;&#x636E;&#x63A2;&#x7D22;&#x3002;</p>
<h2 id="&#x67E5;&#x8BE2;-maprdb-&#x548C;-hbase-&#x8868;">&#x67E5;&#x8BE2; MapR-DB &#x548C; HBase &#x8868;</h2>
<p>&#x5546;&#x54C1;&#x548C;&#x5BA2;&#x6237;&#x7684;&#x8868;&#x90FD;&#x662F; MapR-DB &#x8868;&#x3002;MapR-DB &#x662F;&#x4E00;&#x4E2A;&#x4F01;&#x4E1A;&#x7EA7;&#x7684;&#xFF0C;&#x57FA;&#x4E8E; Hadoop &#x7684; NoSQL &#x6570;&#x636E;&#x5E93;&#x3002;&#x5B83;&#x652F;&#x6301; HBase API &#x5E94;&#x7528;&#x5F00;&#x53D1;&#x3002;&#x6BCF;&#x4E2A; MapR-DB &#x8868;&#x6709;&#x4E00;&#x4E2A; row_key&#xFF0C;&#x53E6;&#x5916;&#xFF0C;&#x6709;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x5217;&#x7C07;&#x3002;&#x6BCF;&#x4E2A;&#x5217;&#x7C07;&#x5305;&#x542B;&#x4E00;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6307;&#x5B9A;&#x7684;&#x5217;&#x3002;row_key &#x88AB;&#x5B9A;&#x4E49;&#x4E3A;&#x4E3B;&#x952E;&#x7528;&#x4E8E;&#x6BCF;&#x4E00;&#x4E2A;&#x884C;&#x8BB0;&#x5F55;&#x3002;</p>
<p>Drill &#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x67E5;&#x8BE2; MapR-DB &#x548C; HBase &#x8868;&#x3002;&#x4E0D;&#x540C;&#x4E0E;&#x5176;&#x4ED6; Hadoop &#x9009;&#x62E9; SQL&#xFF0C;Drill &#x5728;&#x5904;&#x7406;&#x6570;&#x636E;&#x7684;&#x65F6;&#x5019;&#x9700;&#x8981;&#xFF0C;&#x65E0;&#x8986;&#x76D6;&#x7684; Schema &#x5B9A;&#x4E49;&#x4E0E; Hive&#x3002;&#x5F53;&#x4F60;&#x7684; MapR-DB &#x548C; HBase &#x8868;&#x4E2D;&#x4E0A;&#x5343;&#x4E2A;&#x5217;&#x5728;&#x4E00;&#x4E2A;&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#xFF0C;Drill &#x4F1A;&#x4ECE; Hive &#x4E2D;&#x79FB;&#x9664;&#x6B63;&#x5904;&#x7406;&#x7BA1;&#x7406;&#x7684; Schemas&#x3002;</p>
<h3 id="&#x5546;&#x54C1;&#x8868;">&#x5546;&#x54C1;&#x8868;</h3>
<p>&#x5546;&#x54C1;&#x8868;&#x6709;&#x4E24;&#x4E2A;&#x5217;&#x7C07;&#x3002;</p>
<pre><code>+--------------+---------+
|Column Family | Columns |
+--------------+---------+
|details       | name    |
|              | category|
+--------------+---------+
|pricing       | price   |
+--------------+---------+
</code></pre><p>&#x5546;&#x54C1;&#x8868;&#x5305;&#x542B; 965 &#x6761;&#x8BB0;&#x5F55;&#x3002;</p>
<h3 id="&#x5207;&#x6362;&#x5230;-maprdb-&#x7684;&#x5DE5;&#x4F5C;&#x7A7A;&#x95F4;">&#x5207;&#x6362;&#x5230; maprdb &#x7684;&#x5DE5;&#x4F5C;&#x7A7A;&#x95F4;</h3>
<pre><code class="lang-bash">use maprdb;
+-------+-------------------------------------+
|  ok   |               summary               |
+-------+-------------------------------------+
| <span class="hljs-literal">true</span>  | Default schema changed to [maprdb]  |
+-------+-------------------------------------+
<span class="hljs-number">1</span> row selected
</code></pre>
<h3 id="&#x8868;&#x63CF;&#x8FF0;">&#x8868;&#x63CF;&#x8FF0;</h3>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; describe customers;
+--------------+------------------------+--------------+
| COLUMN_NAME  |       DATA_TYPE        | IS_NULLABLE  |
+--------------+------------------------+--------------+
| row_key      | ANY                    | NO           |
| address      | (VARCHAR(<span class="hljs-number">1</span>), ANY) MAP  | NO           |
| loyalty      | (VARCHAR(<span class="hljs-number">1</span>), ANY) MAP  | NO           |
| personal     | (VARCHAR(<span class="hljs-number">1</span>), ANY) MAP  | NO           |
+--------------+------------------------+--------------+
<span class="hljs-number">4</span> rows selected

<span class="hljs-number">0</span>: jdbc:drill:&gt; describe products;
+--------------+------------------------+--------------+
| COLUMN_NAME  |       DATA_TYPE        | IS_NULLABLE  |
+--------------+------------------------+--------------+
| row_key      | ANY                    | NO           |
| details      | (VARCHAR(<span class="hljs-number">1</span>), ANY) MAP  | NO           |
| pricing      | (VARCHAR(<span class="hljs-number">1</span>), ANY) MAP  | NO           |
+--------------+------------------------+--------------+
<span class="hljs-number">3</span> rows selected
</code></pre>
<p>&#x4E0E; Hive &#x4E0D;&#x540C;&#x7684;&#x662F;&#xFF0C;&#x8BE5;&#x547D;&#x4EE4;&#x4E0D;&#x4F1A;&#x5C06;&#x5B8C;&#x6574;&#x7684; Schema &#x8FD4;&#x56DE;&#x5230;&#x5217;&#x7EA7;&#x3002;&#x5BF9;&#x4E8E; NoSQL &#x6570;&#x636E;&#x5E93;&#x6765;&#x8BF4;&#xFF0C;&#x4F8B;&#x5982; MapR-DB &#x548C; HBase &#x80FD;&#x591F;&#x5C06; Schema &#x8BBE;&#x8BA1;&#x7684;&#x5F88;&#x5C11;&#x3002;&#x6BCF;&#x4E00;&#x884C;&#x90FD;&#x6709;&#x81EA;&#x5DF1;&#x7684;&#x5217;&#x5C06;&#x81EA;&#x5DF1;&#x7684;&#x503C;&#x7ED9;&#x5230;&#x81EA;&#x5DF1;&#x6240;&#x5C5E;&#x7684;&#x5217;&#x7C07;&#x4E2D;&#xFF0C;&#x5E76;&#x4E14;&#x5217;&#x7684;&#x503C;&#x80FD;&#x591F;&#x662F;&#x4EFB;&#x610F;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x7531;&#x5E94;&#x8BE5;&#x7A0B;&#x5E8F;&#x53BB;&#x786E;&#x5B9A;&#x6570;&#x636E;&#x7684;&#x7C7B;&#x578B;&#x3002;</p>
<p>&#x4E00;&#x4E2A;&#x590D;&#x6742;&#x7684; &#x201C;MAP&#x201D; &#x96C6;&#x5408;&#x7C7B;&#x578B;&#xFF0C;&#x5728; Drill &#x5448;&#x73B0;&#x7684;&#x65B9;&#x5F0F;&#x5C31;&#x662F;&#x540D;&#x79F0;&#x548C;&#x503C;&#x7684;&#x7ED3;&#x6784;&#xFF08;K/V&#xFF09;&#xFF0C;&#x4E8B;&#x5B9E;&#x4E0A;&#xFF0C;&#x5217;&#x7684;&#x503C;&#x53EF;&#x4EE5;&#x6210;&#x4E3A;&#x4EFB;&#x4F55;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;&#x901A;&#x8FC7;&#x89C2;&#x5BDF; row_key&#xFF0C;&#x5B83;&#x4E5F;&#x662F;&#x4E00;&#x4E2A;&#x7B80;&#x5355;&#x7684;&#x5B57;&#x8282;&#x6216;&#x662F;&#x4EFB;&#x4F55;&#x7C7B;&#x578B;&#x3002;</p>
<h3 id="&#x4ECE;&#x5546;&#x54C1;&#x8868;&#x4E2D;&#x9009;&#x62E9;-5-&#x884C;&#x8BB0;&#x5F55;&#xFF1A;">&#x4ECE;&#x5546;&#x54C1;&#x8868;&#x4E2D;&#x9009;&#x62E9; 5 &#x884C;&#x8BB0;&#x5F55;&#xFF1A;</h3>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; select * from products <span class="hljs-built_in">limit</span> <span class="hljs-number">5</span>;
+--------------+----------------------------------------------------------------------------------------------------------------+-------------------+
|   row_key    |                                                    details                                                     |      pricing      |
+--------------+----------------------------------------------------------------------------------------------------------------+-------------------+
| [B@b01c5f8   | {<span class="hljs-string">&quot;category&quot;</span>:<span class="hljs-string">&quot;bGFwdG9w&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;U29ueSBub3RlYm9vaw==&quot;</span>}                                                          | {<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-string">&quot;OTU5&quot;</span>}  |
| [B@<span class="hljs-number">5</span>edfe5ad  | {<span class="hljs-string">&quot;category&quot;</span>:<span class="hljs-string">&quot;RW52ZWxvcGVz&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;IzEwLTQgMS84IHggOSAxLzIgUHJlbWl1bSBEaWFnb25hbCBTZWFtIEVudmVsb3Blcw==&quot;</span>}      | {<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-string">&quot;MTY=&quot;</span>}  |
| [B@<span class="hljs-number">3</span>d5ff184  | {<span class="hljs-string">&quot;category&quot;</span>:<span class="hljs-string">&quot;U3RvcmFnZSAmIE9yZ2FuaXphdGlvbg==&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;MjQgQ2FwYWNpdHkgTWF4aSBEYXRhIEJpbmRlciBSYWNrc1BlYXJs&quot;</span>}  | {<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-string">&quot;MjEx&quot;</span>}  |
| [B@<span class="hljs-number">65</span>e93096  | {<span class="hljs-string">&quot;category&quot;</span>:<span class="hljs-string">&quot;TGFiZWxz&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;QXZlcnkgNDk4&quot;</span>}                                                                  | {<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-string">&quot;Mw==&quot;</span>}  |
| [B@<span class="hljs-number">3074</span><span class="hljs-built_in">fc</span>1f  | {<span class="hljs-string">&quot;category&quot;</span>:<span class="hljs-string">&quot;TGFiZWxz&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;QXZlcnkgNDk=&quot;</span>}                                                                  | {<span class="hljs-string">&quot;price&quot;</span>:<span class="hljs-string">&quot;Mw==&quot;</span>}  |
+--------------+----------------------------------------------------------------------------------------------------------------+-------------------+
<span class="hljs-number">5</span> rows selected
</code></pre>
<p>&#x9274;&#x4E8E; Drill &#x4E0D;&#x9700;&#x8981;&#x4E8B;&#x5148;&#x5B9A;&#x4E49; Schema &#x53BB;&#x8868;&#x793A;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x67E5;&#x8BE2;&#x8FD4;&#x56DE;&#x7684;&#x5217;&#x503C;&#x662F;&#x5B57;&#x8282;&#x6570;&#x7EC4;&#xFF0C;&#x8FD9;&#x662F;&#x56E0;&#x4E3A;&#x5B83;&#x4EEC;&#x5B58;&#x50A8;&#x5728; MapR-DB&#xFF08;&#x6216; HBase&#xFF09;&#x3002;&#x901A;&#x8FC7;&#x89C2;&#x5BDF;&#x5217;&#x7C07;&#xFF08;details &#x548C; pricing&#xFF09;&#x7531; MAP &#x6570;&#x636E;&#x7C7B;&#x578B;&#x548C; JSON &#x5B57;&#x7B26;&#x4E32;&#x3002;</p>
<p>&#x5728;&#x7B2C; 2 &#x8BFE;&#x4E2D;&#xFF0C;&#x4F60;&#x5C06;&#x4F1A;&#x4F7F;&#x7528; <code>CAST</code> &#x51FD;&#x6570;&#x53BB;&#x83B7;&#x53D6;&#x8FD4;&#x56DE;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x3002;</p>
<h3 id="&#x4ECE;&#x5BA2;&#x6237;&#x8868;&#x4E2D;&#x83B7;&#x53D6;-5-&#x884C;&#x8BB0;&#x5F55;">&#x4ECE;&#x5BA2;&#x6237;&#x8868;&#x4E2D;&#x83B7;&#x53D6; 5 &#x884C;&#x8BB0;&#x5F55;</h3>
<pre><code class="lang-bash">
+<span class="hljs-number">0</span>: jdbc:drill:&gt; select * from customers <span class="hljs-built_in">limit</span> <span class="hljs-number">5</span>;
+--------------+-----------------------+-------------------------------------------------+---------------------------------------------------------------------------------------+
|   row_key    |        address        |                     loyalty                     |                                       personal                                        |
+--------------+-----------------------+-------------------------------------------------+---------------------------------------------------------------------------------------+
| [B@<span class="hljs-number">3</span>ed2649e  | {<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;InZhIg==&quot;</span>}  | {<span class="hljs-string">&quot;agg_rev&quot;</span>:<span class="hljs-string">&quot;MTk3&quot;</span>,<span class="hljs-string">&quot;membership&quot;</span>:<span class="hljs-string">&quot;InNpbHZlciI=&quot;</span>}  | {<span class="hljs-string">&quot;age&quot;</span>:<span class="hljs-string">&quot;IjE1LTIwIg==&quot;</span>,<span class="hljs-string">&quot;gender&quot;</span>:<span class="hljs-string">&quot;IkZFTUFMRSI=&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;IkNvcnJpbmUgTWVjaGFtIg==&quot;</span>}      |
| [B@<span class="hljs-number">66</span>cbe14a  | {<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;ImluIg==&quot;</span>}  | {<span class="hljs-string">&quot;agg_rev&quot;</span>:<span class="hljs-string">&quot;MjMw&quot;</span>,<span class="hljs-string">&quot;membership&quot;</span>:<span class="hljs-string">&quot;InNpbHZlciI=&quot;</span>}  | {<span class="hljs-string">&quot;age&quot;</span>:<span class="hljs-string">&quot;IjI2LTM1Ig==&quot;</span>,<span class="hljs-string">&quot;gender&quot;</span>:<span class="hljs-string">&quot;Ik1BTEUi&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;IkJyaXR0YW55IFBhcmsi&quot;</span>}              |
| [B@<span class="hljs-number">5333</span>f5ff  | {<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;ImNhIg==&quot;</span>}  | {<span class="hljs-string">&quot;agg_rev&quot;</span>:<span class="hljs-string">&quot;MjUw&quot;</span>,<span class="hljs-string">&quot;membership&quot;</span>:<span class="hljs-string">&quot;InNpbHZlciI=&quot;</span>}  | {<span class="hljs-string">&quot;age&quot;</span>:<span class="hljs-string">&quot;IjI2LTM1Ig==&quot;</span>,<span class="hljs-string">&quot;gender&quot;</span>:<span class="hljs-string">&quot;Ik1BTEUi&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;IlJvc2UgTG9rZXki&quot;</span>}                  |
| [B@<span class="hljs-number">785</span>b6305  | {<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;Im1lIg==&quot;</span>}  | {<span class="hljs-string">&quot;agg_rev&quot;</span>:<span class="hljs-string">&quot;MjYz&quot;</span>,<span class="hljs-string">&quot;membership&quot;</span>:<span class="hljs-string">&quot;InNpbHZlciI=&quot;</span>}  | {<span class="hljs-string">&quot;age&quot;</span>:<span class="hljs-string">&quot;IjUxLTEwMCI=&quot;</span>,<span class="hljs-string">&quot;gender&quot;</span>:<span class="hljs-string">&quot;IkZFTUFMRSI=&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;IkphbWVzIEZvd2xlciI=&quot;</span>}          |
| [B@<span class="hljs-number">37</span>c21afe  | {<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;Im1uIg==&quot;</span>}  | {<span class="hljs-string">&quot;agg_rev&quot;</span>:<span class="hljs-string">&quot;MjAy&quot;</span>,<span class="hljs-string">&quot;membership&quot;</span>:<span class="hljs-string">&quot;InNpbHZlciI=&quot;</span>}  | {<span class="hljs-string">&quot;age&quot;</span>:<span class="hljs-string">&quot;IjUxLTEwMCI=&quot;</span>,<span class="hljs-string">&quot;gender&quot;</span>:<span class="hljs-string">&quot;Ik9USEVSIg==&quot;</span>,<span class="hljs-string">&quot;name&quot;</span>:<span class="hljs-string">&quot;Ikd1aWxsZXJtbyBLb2VobGVyIg==&quot;</span>}  |
+--------------+-----------------------+-------------------------------------------------+---------------------------------------------------------------------------------------+
<span class="hljs-number">5</span> rows selected
</code></pre>
<p>&#x53E6;&#x5916;&#xFF0C;&#x8868;&#x8FD4;&#x56DE;&#x7684;&#x5B57;&#x8282;&#x6570;&#x636E;&#x662F;&#x9700;&#x8981;&#x8F6C;&#x6362;&#x672A;&#x53EF;&#x8BFB;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#x7684;&#x3002;</p>
<h3 id="&#x67E5;&#x8BE2;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;">&#x67E5;&#x8BE2;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;</h3>
<p>&#x968F;&#x7740;&#x63D2;&#x53D9;&#x6570;&#x636E;&#x6E90;&#x4EE5;&#x5168; Schema&#xFF08;&#x4F8B;&#x5982; Hive&#xFF09;&#x548C;&#x90E8;&#x5206; Schema&#xFF08;&#x4F8B;&#x5982; MapR-DB &#x548C; HBase&#xFF09;&#xFF0C;Drill &#x63D0;&#x4F9B;&#x4E86;&#x76F4;&#x63A5;&#x5728;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x5904;&#x7406; SQL &#x67E5;&#x8BE2;&#x7684;&#x80FD;&#x529B;&#x3002;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E00;&#x822C;&#x6709;&#x672C;&#x5730;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF0C;&#x5206;&#x5E03;&#x5F0F;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#xFF0C;&#x4F8B;&#x5982; MapR-FS&#xFF0C;HDFS &#x6216;&#x662F; S3&#x3002;</p>
<p>&#x5728; Drill &#x4E2D;&#xFF0C;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x6216;&#x662F;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#x4EE3;&#x8868;&#x4E00;&#x4E2A;&#x5173;&#x7CFB;&#x578B;&#x6570;&#x636E;&#x5E93;&#x4E2D;&#x7684;&#x201C;&#x8868;&#x201D;&#x3002;&#x56E0;&#x6B64;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x6267;&#x884C; SQL &#x7528;&#x4E8E;&#x6587;&#x4EF6;&#x548C;&#x76EE;&#x5F55;&#x3002;Schema &#x662F;&#x57FA;&#x4E8E;&#x67E5;&#x8BE2;&#x7684;&#x57FA;&#x7840;&#x4E0A;&#x53D1;&#x73B0;&#x7684;&#x3002;&#x800C;&#x4E14; Drill &#x652F;&#x6301;&#x591A;&#x79CD;&#x6587;&#x4EF6;&#x683C;&#x5F0F;&#xFF0C;&#x5176;&#x4E2D;&#x5305;&#x542B; text&#xFF0C;CSV&#xFF0C;Parquet &#x548C; JSON&#x3002;</p>
<p>&#x4E0B;&#x9762;&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x662F;&#x6765;&#x6E90;&#x4E8E;&#x624B;&#x673A;&#x7AEF;/&#x7F51;&#x9875;&#x7AEF;&#x5E94;&#x7528;&#x7684; JSON &#x683C;&#x5F0F;&#x7684;&#x70B9;&#x51FB;&#x91CF;&#x6570;&#x636E;&#x3002;JSON &#x6587;&#x4EF6;&#x683C;&#x5F0F;&#x5982;&#x4E0B;&#x6240;&#x793A;&#xFF1A;</p>
<pre><code class="lang-json">{<span class="hljs-string">&quot;trans_id&quot;</span>:<span class="hljs-number">31920</span>,<span class="hljs-string">&quot;date&quot;</span>:<span class="hljs-string">&quot;2014-04-26&quot;</span>,<span class="hljs-string">&quot;time&quot;</span>:<span class="hljs-string">&quot;12:17:12&quot;</span>,<span class="hljs-string">&quot;user_info&quot;</span>:{<span class="hljs-string">&quot;cust_id&quot;</span>:<span class="hljs-number">22526</span>,<span class="hljs-string">&quot;device&quot;</span>:<span class="hljs-string">&quot;IOS5&quot;</span>,<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;il&quot;</span>},<span class="hljs-string">&quot;trans_info&quot;</span>:{<span class="hljs-string">&quot;prod_id&quot;</span>:[<span class="hljs-number">174</span>,<span class="hljs-number">2</span>],<span class="hljs-string">&quot;purch_flag&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>}}
{<span class="hljs-string">&quot;trans_id&quot;</span>:<span class="hljs-number">31026</span>,<span class="hljs-string">&quot;date&quot;</span>:<span class="hljs-string">&quot;2014-04-20&quot;</span>,<span class="hljs-string">&quot;time&quot;</span>:<span class="hljs-string">&quot;13:50:29&quot;</span>,<span class="hljs-string">&quot;user_info&quot;</span>:{<span class="hljs-string">&quot;cust_id&quot;</span>:<span class="hljs-number">16368</span>,<span class="hljs-string">&quot;device&quot;</span>:<span class="hljs-string">&quot;AOS4.2&quot;</span>,<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;nc&quot;</span>},<span class="hljs-string">&quot;trans_info&quot;</span>:{<span class="hljs-string">&quot;prod_id&quot;</span>:[],<span class="hljs-string">&quot;purch_flag&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>}}
{<span class="hljs-string">&quot;trans_id&quot;</span>:<span class="hljs-number">33848</span>,<span class="hljs-string">&quot;date&quot;</span>:<span class="hljs-string">&quot;2014-04-10&quot;</span>,<span class="hljs-string">&quot;time&quot;</span>:<span class="hljs-string">&quot;04:44:42&quot;</span>,<span class="hljs-string">&quot;user_info&quot;</span>:{<span class="hljs-string">&quot;cust_id&quot;</span>:<span class="hljs-number">21449</span>,<span class="hljs-string">&quot;device&quot;</span>:<span class="hljs-string">&quot;IOS6&quot;</span>,<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;oh&quot;</span>},<span class="hljs-string">&quot;trans_info&quot;</span>:{<span class="hljs-string">&quot;prod_id&quot;</span>:[<span class="hljs-number">582</span>],<span class="hljs-string">&quot;purch_flag&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>}}
</code></pre>
<p>clicks.json &#x548C; clicks.campaign.json &#x6587;&#x4EF6;&#x5305;&#x542B;&#x5143;&#x6570;&#x636E;&#x4F5C;&#x4E3A;&#x6570;&#x636E;&#x672C;&#x8EAB;&#x7684;&#x4E00;&#x90E8;&#x5206;&#xFF08;&#x79F0;&#x4E3A;&#x201C;&#x81EA;&#x6211;&#x63CF;&#x8FF0;&#x201D;&#x7684;&#x6570;&#x636E;&#xFF09;&#x3002;&#x6570;&#x636E;&#x5143;&#x7D20;&#x672C;&#x8EAB;&#x590D;&#x6742;&#x590D;&#x6742;&#xFF0C;&#x8FD8;&#x505A;&#x4E86;&#x5D4C;&#x5957;&#x3002;&#x521D;&#x59CB;&#x5316;&#x67E5;&#x8BE2;&#x4E0D;&#x663E;&#x793A;&#x5982;&#x4F55;&#x53BB;&#x89E3;&#x6790;&#x5D4C;&#x5957;&#x6570;&#x636E;&#xFF0C;&#x4F46;&#x662F;&#x5B83;&#x4EEC;&#x4F1A;&#x5F88;&#x5BB9;&#x6613;&#x7684;&#x8FDB;&#x5165;&#x5230;&#x6570;&#x636E;&#xFF0C;&#x800C;&#x4E0D;&#x9700;&#x8981;&#x53BB;&#x5DE5;&#x4F5C;&#x7A7A;&#x95F4;&#x5B9A;&#x4E49;&#x3002;</p>
<h3 id="&#x67E5;&#x8BE2;&#x5D4C;&#x5957;&#x70B9;&#x51FB;&#x91CF;&#x6570;&#x636E;">&#x67E5;&#x8BE2;&#x5D4C;&#x5957;&#x70B9;&#x51FB;&#x91CF;&#x6570;&#x636E;</h3>
<p>&#x5207;&#x6362;&#x5230; dfs.clicks &#x5DE5;&#x4F5C;&#x7A7A;&#x95F4;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; use dfs.clicks;
+-------+-----------------------------------------+
|  ok   |                 summary                 |
+-------+-----------------------------------------+
| <span class="hljs-literal">true</span>  | Default schema changed to [dfs.clicks]  |
+-------+-----------------------------------------+
<span class="hljs-number">1</span> row selected
</code></pre>
<p>&#x5728;&#x8FD9;&#x79CD;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x8BBE;&#x7F6E;&#x5DE5;&#x4F5C;&#x533A;&#x95F4;&#x4F7F;&#x67E5;&#x8BE2;&#x53D8;&#x5F97;&#x66F4;&#x52A0;&#x5BB9;&#x6613;&#x3002;&#x5F53;&#x4F60;&#x6307;&#x5B9A;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x5230;&#x5DE5;&#x4F5C;&#x533A;&#x95F4;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x7F29;&#x77ED;&#x4F60;&#x7684;&#x67E5;&#x8BE2;&#x8DEF;&#x5F84;&#xFF08;&#x6307;&#x5411;&#x53D8;&#x77ED;&#xFF09;&#x3002;&#x800C;&#x4E0D;&#x5FC5;&#x4E3A;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x63D0;&#x4F9B;&#x5B8C;&#x6574;&#x7684;&#x8DEF;&#x5F84;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x63D0;&#x4F9B;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x7684;&#x76F8;&#x5BF9;&#x8DEF;&#x5F84;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code>&quot;location&quot;: &quot;/mapr/demo.mapr.com/data/nested&quot;
</code></pre><p>&#x5728;&#x8FD9;&#x4E2A;&#x76F8;&#x5BF9;&#x8DEF;&#x5F84;&#x4E0B;&#xFF0C;&#x4EFB;&#x4F55;&#x6587;&#x4EF6;&#x548C;&#x76EE;&#x5F55;&#x4F60;&#x90FD;&#x53EF;&#x4EE5;&#x53BB;&#x67E5;&#x8BE2;&#x3002;&#x4E0B;&#x9762;&#x7684;&#x67E5;&#x8BE2;&#x6240;&#x6307;&#x7684;&#x662F;&#x76F4;&#x63A5;&#x5728;&#x76EE;&#x5F55;&#x4E2D;&#x5D4C;&#x5957;&#x3002;</p>
<p>&#x4ECE; clicks.json &#x6587;&#x4EF6;&#x4E2D;&#x9009;&#x62E9; 2 &#x884C;&#x8BB0;&#x5F55;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; select * from `clicks/clicks.json` <span class="hljs-built_in">limit</span> <span class="hljs-number">2</span>;
+-----------+-------------+-----------+---------------------------------------------------+-------------------------------------------+
| trans_id  |    date     |   time    |                     user_info                     |                trans_info                 |
+-----------+-------------+-----------+---------------------------------------------------+-------------------------------------------+
| <span class="hljs-number">31920</span>     | <span class="hljs-number">2014</span>-<span class="hljs-number">04</span>-<span class="hljs-number">26</span>  | <span class="hljs-number">12</span>:<span class="hljs-number">17</span>:<span class="hljs-number">12</span>  | {<span class="hljs-string">&quot;cust_id&quot;</span>:<span class="hljs-number">22526</span>,<span class="hljs-string">&quot;device&quot;</span>:<span class="hljs-string">&quot;IOS5&quot;</span>,<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;il&quot;</span>}    | {<span class="hljs-string">&quot;prod_id&quot;</span>:[<span class="hljs-number">174</span>,<span class="hljs-number">2</span>],<span class="hljs-string">&quot;purch_flag&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>}  |
| <span class="hljs-number">31026</span>     | <span class="hljs-number">2014</span>-<span class="hljs-number">04</span>-<span class="hljs-number">20</span>  | <span class="hljs-number">13</span>:<span class="hljs-number">50</span>:<span class="hljs-number">29</span>  | {<span class="hljs-string">&quot;cust_id&quot;</span>:<span class="hljs-number">16368</span>,<span class="hljs-string">&quot;device&quot;</span>:<span class="hljs-string">&quot;AOS4.2&quot;</span>,<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;nc&quot;</span>}  | {<span class="hljs-string">&quot;prod_id&quot;</span>:[],<span class="hljs-string">&quot;purch_flag&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>}       |
+-----------+-------------+-----------+---------------------------------------------------+-------------------------------------------+
<span class="hljs-number">2</span> rows selected
</code></pre>
<p>&#x8FD9;&#x4E2A; <code>FROM</code> &#x8BED;&#x53E5;&#x6267;&#x884C;&#x4E00;&#x4E2A;&#x7279;&#x5B9A;&#x7684;&#x6587;&#x4EF6;&#x3002;Drill &#x6269;&#x5C55;&#x4E86;&#x4F20;&#x7EDF;&#x7684;&#x8868;&#x6982;&#x5FF5;&#x3002;&#x5B83;&#x5BF9;&#x6BD4;&#x4F20;&#x7EDF;&#x7684; SQL &#x4E2D;&#x7684; <code>FROM</code>&#xFF0C;&#x80FD;&#x591F;&#x9002;&#x5408;&#x4E00;&#x4E2A;&#x672C;&#x5730;&#x6587;&#x4EF6;&#x6216;&#x662F;&#x5206;&#x5E03;&#x5F0F;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x3002;</p>
<p>&#x552F;&#x4E00;&#x7684;&#x8981;&#x6C42;&#x662F;&#x9700;&#x8981;&#x6211;&#x4EEC;&#x53BB;&#x53EF;&#x4EE5;&#x5C01;&#x88C5;&#x6587;&#x4EF6;&#x8DEF;&#x5F84;&#x3002;&#x8FD9;&#x4E2A;&#x662F;&#x6709;&#x5FC5;&#x8981;&#x7684;&#xFF0C;&#x907F;&#x514D;&#x4E8E; Drill &#x7684;&#x4FDD;&#x7559;&#x5B57;&#x7B26;&#x51B2;&#x7A81;&#x3002;</p>
<p>&#x4ECE; campaign.json &#x6587;&#x4EF6;&#x4E2D;&#x9009;&#x62E9; 2 &#x884C;&#x8BB0;&#x5F55;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; select * from `clicks/clicks.campaign.json` <span class="hljs-built_in">limit</span> <span class="hljs-number">2</span>;
+-----------+-------------+-----------+---------------------------------------------------+---------------------+----------------------------------------+
| trans_id  |    date     |   time    |                     user_info                     |       ad_info       |               trans_info               |
+-----------+-------------+-----------+---------------------------------------------------+---------------------+----------------------------------------+
| <span class="hljs-number">35232</span>     | <span class="hljs-number">2014</span>-<span class="hljs-number">05</span>-<span class="hljs-number">10</span>  | <span class="hljs-number">00</span>:<span class="hljs-number">13</span>:<span class="hljs-number">03</span>  | {<span class="hljs-string">&quot;cust_id&quot;</span>:<span class="hljs-number">18520</span>,<span class="hljs-string">&quot;device&quot;</span>:<span class="hljs-string">&quot;AOS4.3&quot;</span>,<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;tx&quot;</span>}  | {<span class="hljs-string">&quot;camp_id&quot;</span>:<span class="hljs-string">&quot;null&quot;</span>}  | {<span class="hljs-string">&quot;prod_id&quot;</span>:[<span class="hljs-number">7</span>,<span class="hljs-number">7</span>],<span class="hljs-string">&quot;purch_flag&quot;</span>:<span class="hljs-string">&quot;true&quot;</span>}  |
| <span class="hljs-number">31995</span>     | <span class="hljs-number">2014</span>-<span class="hljs-number">05</span>-<span class="hljs-number">22</span>  | <span class="hljs-number">16</span>:<span class="hljs-number">06</span>:<span class="hljs-number">38</span>  | {<span class="hljs-string">&quot;cust_id&quot;</span>:<span class="hljs-number">17182</span>,<span class="hljs-string">&quot;device&quot;</span>:<span class="hljs-string">&quot;IOS6&quot;</span>,<span class="hljs-string">&quot;state&quot;</span>:<span class="hljs-string">&quot;fl&quot;</span>}    | {<span class="hljs-string">&quot;camp_id&quot;</span>:<span class="hljs-string">&quot;null&quot;</span>}  | {<span class="hljs-string">&quot;prod_id&quot;</span>:[],<span class="hljs-string">&quot;purch_flag&quot;</span>:<span class="hljs-string">&quot;false&quot;</span>}    |
+-----------+-------------+-----------+---------------------------------------------------+---------------------+----------------------------------------+
<span class="hljs-number">2</span> rows selected
</code></pre>
<p>&#x9700;&#x8981;&#x6CE8;&#x610F;&#x7684;&#x662F;&#xFF0C;&#x5728;&#x4F7F;&#x7528; <code>select *</code> &#x505A;&#x67E5;&#x8BE2;&#x7684;&#x9002;&#x5408;&#xFF0C;&#x4E00;&#x4E9B;&#x590D;&#x6742;&#x7684;&#x6570;&#x636E;&#x7C7B;&#x578B;&#xFF0C;&#x4F8B;&#x5982; maps &#x548C; arrays &#x4F1A;&#x8FD4;&#x56DE;&#x4E00;&#x4E2A; JSON &#x5B57;&#x7B26;&#x4E32;&#x3002;&#x5728;&#x4E0B;&#x4E00;&#x8BFE;&#xFF0C;&#x4F60;&#x5C06;&#x4F1A;&#x660E;&#x767D;&#x5229;&#x7528;&#x4E0D;&#x540C;&#x7684; SQL &#x51FD;&#x6570; &#x53BB;&#x89E3;&#x6790;&#x8FD9;&#x4E9B;&#x6570;&#x636E;&#x3002;</p>
<h2 id="&#x67E5;&#x8BE2;&#x65E5;&#x5FD7;&#x6570;&#x636E;">&#x67E5;&#x8BE2;&#x65E5;&#x5FD7;&#x6570;&#x636E;</h2>
<p>&#x4E0D;&#x50CF;&#x4E4B;&#x524D;&#x7684;&#x4F8B;&#x5B50;&#xFF0C;&#x6211;&#x4EEC;&#x662F;&#x5728;&#x4E00;&#x4E2A;&#x6587;&#x4EF6;&#x4E2D;&#x5BF9;&#x70B9;&#x51FB;&#x6570;&#x8FDB;&#x884C;&#x67E5;&#x8BE2;&#x3002;&#x65E5;&#x5FD7;&#x6570;&#x636E;&#x88AB;&#x5B58;&#x653E;&#x5728;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x7684;&#x5206;&#x533A;&#x76EE;&#x5F55;&#x3002;&#x8FD9;&#x91CC;&#x65E5;&#x5FD7;&#x76EE;&#x5F55;&#x6709;&#x4E09;&#x4E2A;&#x5B50;&#x76EE;&#x5F55;&#xFF1A;</p>
<ul>
<li>2012</li>
<li>2013</li>
<li>2014</li>
</ul>
<p>&#x8FD9;&#x4E9B;&#x5E74;&#x7684;&#x6570;&#x636E;&#x76EE;&#x5F55;&#x7531;&#x4E00;&#x7EC4;&#x7EC4;&#x7684;&#x6708;&#x76EE;&#x5F55;&#x6784;&#x6210;&#xFF0C;&#x6BCF;&#x4E2A;&#x6708;&#x76EE;&#x5F55;&#x5305;&#x542B;&#x4E00;&#x4E2A; JSON &#x6587;&#x4EF6;&#xFF0C;&#x91CC;&#x9762;&#x5305;&#x542B;&#x4E86;&#x65E5;&#x5FD7;&#x8BB0;&#x5F55;&#x3002;&#x6240;&#x6709;&#x7684;&#x65E5;&#x5FD7;&#x6587;&#x4EF6;&#x7684;&#x8BB0;&#x5F55;&#x603B;&#x6570;&#x4E3A; 48000&#x3002;</p>
<p>&#x5728;&#x65E5;&#x5FD7;&#x6587;&#x4EF6;&#x76EE;&#x5F55;&#x548C;&#x5B50;&#x76EE;&#x5F55;&#x4E0B;&#x7684;&#x90FD;&#x662F; JSON &#x6587;&#x4EF6;&#x3002;&#x8FD9;&#x4E9B;&#x6587;&#x4EF6;&#x6BD4;&#x8F83;&#x591A;&#xFF0C;&#x4F46;&#x662F;&#x4F60;&#x53EA;&#x9700;&#x8981;&#x4F7F;&#x7528; Drill &#x53BB;&#x67E5;&#x8BE2;&#x5355;&#x4E2A;&#x6570;&#x636E;&#x6E90;&#x6216;&#x8005;&#x67E5;&#x8BE2;&#x5B50;&#x6587;&#x4EF6;&#x3002;</p>
<p>&#x5207;&#x6362;&#x5230; dfs.logs &#x5DE5;&#x4F5C;&#x7A7A;&#x95F4;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; use dfs.logs;
+-------+---------------------------------------+
|  ok   |                summary                |
+-------+---------------------------------------+
| <span class="hljs-literal">true</span>  | Default schema changed to [dfs.logs]  |
+-------+---------------------------------------+
<span class="hljs-number">1</span> row selected
</code></pre>
<p>&#x4ECE;&#x65E5;&#x5FD7;&#x76EE;&#x5F55;&#x4E2D;&#x9009;&#x62E9; 2 &#x884C;&#x8BB0;&#x5F55;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; select * from logs <span class="hljs-built_in">limit</span> <span class="hljs-number">2</span>;
+-------+-------+-----------+-------------+-----------+----------+---------+--------+----------+-----------+----------+-------------+
| dir0  | dir1  | trans_id  |    date     |   time    | cust_id  | device  | state  | camp_id  | keywords  | prod_id  | purch_flag  |
+-------+-------+-----------+-------------+-----------+----------+---------+--------+----------+-----------+----------+-------------+
| <span class="hljs-number">2012</span>  | <span class="hljs-number">8</span>     | <span class="hljs-number">109</span>       | <span class="hljs-number">08</span>/<span class="hljs-number">07</span>/<span class="hljs-number">2012</span>  | <span class="hljs-number">20</span>:<span class="hljs-number">33</span>:<span class="hljs-number">13</span>  | <span class="hljs-number">144618</span>   | IOS5    | ga     | <span class="hljs-number">4</span>        | hey       | <span class="hljs-number">6</span>        | <span class="hljs-literal">false</span>       |
| <span class="hljs-number">2012</span>  | <span class="hljs-number">8</span>     | <span class="hljs-number">119</span>       | <span class="hljs-number">08</span>/<span class="hljs-number">19</span>/<span class="hljs-number">2012</span>  | <span class="hljs-number">03</span>:<span class="hljs-number">37</span>:<span class="hljs-number">50</span>  | <span class="hljs-number">17</span>       | IOS5    | tx     | <span class="hljs-number">16</span>       | and       | <span class="hljs-number">50</span>       | <span class="hljs-literal">false</span>       |
+-------+-------+-----------+-------------+-----------+----------+---------+--------+----------+-----------+----------+-------------+
<span class="hljs-number">2</span> rows selected
</code></pre>
<p>&#x6CE8;&#x610F;&#xFF0C;&#x8FD9;&#x4E9B;&#x90FD;&#x662F; JSON &#x6570;&#x636E;&#x3002;dfs.clicks &#x7684;&#x5DE5;&#x4F5C;&#x533A;&#x95F4;&#x6307;&#x5411;&#x4E00;&#x4E2A;&#x76EE;&#x5F55;&#xFF0C;&#x5176;&#x4E2D;&#x5305;&#x542B;&#x4E00;&#x4E2A;&#x65E5;&#x5FD7;&#x76EE;&#x5F55;&#xFF0C;&#x5C31;&#x662F;&#x4F7F;&#x7528; <code>FROM</code> &#x8BED;&#x6CD5;&#x505A;&#x67E5;&#x8BE2;&#x65F6;&#xFF0C;&#x6307;&#x5411;&#x7684;&#x76EE;&#x5F55;&#x3002;&#x5728;&#x6587;&#x4EF6;&#x7CFB;&#x7EDF;&#x4E2D;&#xFF0C;&#x4F60;&#x4E0D;&#x9700;&#x8981;&#x6307;&#x540D;&#x5B8C;&#x6574;&#x7684;&#x76EE;&#x5F55;&#x8DEF;&#x5F84;&#x3002;</p>
<p>&#x5217;&#x540D; dir0 &#x548C; dir1 &#x662F; Drill &#x8868;&#x793A;&#x53EF;&#x53D8;&#x53D8;&#x91CF;&#x7684;&#x4E00;&#x79CD;&#x65B9;&#x5F0F;&#x3002;&#x5728;&#x7B2C; 3 &#x8BFE;&#x4E2D;&#xFF0C;&#x4F60;&#x5C06;&#x5229;&#x7528;&#x8FD9;&#x4E9B;&#x52A8;&#x6001;&#x53D8;&#x91CF;&#xFF0C;&#x505A;&#x66F4;&#x590D;&#x6742;&#x7684;&#x67E5;&#x8BE2;&#x3002;</p>
<p>&#x7EDF;&#x8BA1;&#x6240;&#x6709;&#x6587;&#x4EF6;&#x7684;&#x603B;&#x884C;&#x6570;&#xFF08;&#x6240;&#x6709;&#x7684;&#x6587;&#x4EF6;&#xFF09;&#xFF1A;</p>
<pre><code class="lang-bash"><span class="hljs-number">0</span>: jdbc:drill:&gt; select count(*) from logs;
+---------+
| EXPR<span class="hljs-variable">$0</span>  |
+---------+
| <span class="hljs-number">48000</span>   |
+---------+
<span class="hljs-number">1</span> row selected
</code></pre>
<p>&#x6B64;&#x67E5;&#x8BE2;&#x904D;&#x5386;&#x6240;&#x6709;&#x7684;&#x6587;&#x4EF6;&#x5728;&#x65E5;&#x5FD7;&#x76EE;&#x5F55;&#x53CA;&#x5176;&#x5B50;&#x76EE;&#x5F55;&#x4E2D;&#x7684;&#x6587;&#x4EF6;&#xFF0C;&#x5E76;&#x8FD4;&#x56DE;&#x884C;&#x6570;.</p>
<footer class="page-footer"><span class="copyright">Copyright &#xA9; http://drill.smartloli.org 2016 all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">Modify: 
2016-01-08 16:15:39
</span></footer>
                    
                    </section>
                
                
                </div>
            </div>
        </div>

        
        <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/3.在 Sandbox 中使用 Drill.html" class="navigation navigation-prev " aria-label="Previous page: 3.在 Sandbox 中使用 Drill"><i class="fa fa-angle-left"></i></a>
        
        
        <a href="../../3.教程/4.在 MapR 的 Sandbox 中学习 Drill/5.课程2:使用 ANSI SQL 查询.html" class="navigation navigation-next " aria-label="Next page: 5.课程2:使用 ANSI SQL 查询"><i class="fa fa-angle-right"></i></a>
        
    </div>
</div>

        
<script src="../../gitbook/app.js"></script>

    
    <script src="../../gitbook/plugins/gitbook-plugin-baidu/plugin.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
    

    
    <script src="../../gitbook/plugins/gitbook-plugin-livereload/plugin.js"></script>
    

<script>
require(["gitbook"], function(gitbook) {
    var config = {"tbfed-pagefooter":{"copyright":"Copyright &copy http://drill.smartloli.org 2016","modify_label":"Modify: ","modify_format":"YYYY-MM-DD HH:mm:ss"},"baidu":{"token":""},"fontsettings":{"size":1,"theme":"white","family":"sans"},"highlight":{},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"livereload":{}};
    gitbook.start(config);
});
</script>

        <script>var _hmt = _hmt || [];(function() {var hm = document.createElement('script');hm.src = '//hm.baidu.com/hm.js?';var s = document.getElementsByTagName('script')[0];s.parentNode.insertBefore(hm, s);})();</script>
    </body>
    
</html>
